package org.reliablesource.jdt.viewers;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
import org.reliablesource.jdt.model.ISourceElementInfo;
import org.reliablesource.model.core.IReliableElement;
import org.reliablesource.model.core.ReliableCoreActivator;

/**
 *
 *  JavaElementTableLabelProvider.java<br>
 *  Copyright (c) 2007, Reliable Source, Inc. All Rights Reserved<br><br>
 *
 *	Created on: Apr 19, 2007 <br><br>
 *  @author Dennis Park 
 *<a href="mailto:dennis.park@gmail.com">dennis.park@gmail.com</a>
 *
 * @since 1.0.0
 */
public class JavaElementTableLabelProvider extends LabelProvider implements ITableLabelProvider {
	
	protected Viewer viewer;
	
	public JavaElementTableLabelProvider(){
		super();
	}
	
	public JavaElementTableLabelProvider(Viewer _viewer){
		this();
		viewer = _viewer;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object,
	 *      int)
	 */
	public String getColumnText(Object _element, int _columnIndex) {
		if (null != _element && _columnIndex >= 0)
			if (_element instanceof IReliableElement) {
				IReliableElement _obj = (IReliableElement) _element;
				if (_columnIndex <= ISourceElementInfo.PROPERTIES.length) {
					String _propValue = (String) _obj
							.getProperty(ISourceElementInfo.PROPERTIES[_columnIndex]);
					return _propValue;
				}
			}
		return ReliableCoreActivator.EMPTY_STRING;
	}

	public Image getColumnImage(Object element, int columnIndex) {
		return null;
	}
}
